package algorithm;

/**
 *  常数阶 - O(1)
 */
public class Demo4 {
    public static void main(String[] args) {
        int sum = 0, n = 100;
        sum = (1 + n) * n / 2;
        System.out.println(sum);
    }
}
